package com.io.model;

import java.util.List;

/**
 * Created by yangyx on 2016/7/27.
 */
public class RealTime {

    public String _id;                              //_id
    public VehicleCommon vehicleCommon;             //整车数据(通用) - v
    public BatterySummary batterySummary;           //电池概况 - bs
    public BatteryVoltage batteryVoltage;           //电池电压详情 - bv
    public BatteryTemperature batteryTemperature;   //电池温度详情 - bt
    public MotorMcuDcdc motorMcuDcdc;               //电机/MCU/DCDC - mt
    public AirConditionCommon airConditionCommon;   //空调(通用) - ac
    public AirConditionEv airConditionEv;           //电动车空调 - eac
    public OnboardCharger onboardCharger;           //车载充电机 - chg

    //整车数据(通用) 0x01
    public static class VehicleCommon {
        public int longitude;                       //经度 - lo
        public int latitude;                        //纬度 - la
        public short velocity;                      //时速 - v
        public short altitude;                      //海拔 - al
        public short direction;                     //朝向 - dr
        public int mileage;                         //里程(km 小数位:1) - ml
        public byte shift;                          //档位 - sh
        public byte acceleratorRange;               //加速踏板行程(%) - ar
        public byte brakeRange;                     //制动踏板行程(%) - br
        public byte veerAngle;                      //转角(°) - va
    }

    //电池概况 0x02
    public static class BatterySummary {
        public byte soc;                            //剩余电量(%) - soc
        public byte soh;                            //电池健康度(%) - soh
        public short totalVoltage;                  //电池总电压(V) - tvol
        public short totalCurrent;                  //电池总电流(A) - tcur

        public byte peakVoltagePkgNo;               //峰值电压单体电池所在的电池包的序号 - pvpn
        public byte peakVoltageCellNo;              //峰值电压单体电池的序号 - pvcn
        public short peakVoltageCellValue;          //峰值电压单体电池电压值(V),14554表示14.554V - pvcv

        public byte valleyVoltagePkgNo;             //谷值电压单体电池所在的电池包的序号 - vvpn
        public byte valleyVoltageCellNo;            //谷值电压单体电池的序号 - vvcn
        public short valleyVoltageCellValue;        //谷值电压单体电池电压值(V),13221表示13.221V - vvcv

        public byte peakTempPkgNo;                  //峰值温度探针所在的电池包的序号 - ptpn
        public byte peakTempCellNo;                 //峰值温度探针的序号 - ptcn
        public byte peakTempCellValue;              //峰值温度探针温度值(℃) - ptcv

        public byte valleyTempPkgNo;                //谷值温度探针所在的电池包的序号 - vtpn
        public byte valleyTempCellNo;               //谷值温度探针的序号 - vtcn
        public byte valleyTempCellValue;            //峰值温度探针温度值(℃) - vtcv
    }

    //电池电压详情 0x03
    public static class BatteryVoltage{
        public List<Short> batteryVoltage1;         //电池电压详情1 - bv1
        public List<Short> batteryVoltage2;         //电池电压详情2 - bv2
    }

    //电池温度详情 0x04
    public static class BatteryTemperature{
        public List<Byte> batteryTemps1;            //电池温度详情1 - bt1
        public List<Byte> batteryTemps2;            //电池温度详情2 - bt2
    }

    //电动系统(电机/MCU/DCDC) 0x05
    public static class MotorMcuDcdc{
        public short motorOutputTorque;             //电机输出扭矩(Nm),0~300 - mot
        public short motorRpm;                      //电机转速(RPM),0~10000 - rpm
        public byte mcuTemperature;                 //电机控制器温度(℃),-40~120 - mcut
        public byte motorTemperature;               //电机温度(℃),-40~120 - mtt

        public short mcuBusVoltage;                 //电机控制器母线电压(V),0~500 - mcuv
        public short mcuBusCurrent;                 //电机控制器母线电流(A),0~300 - mcuc

        public short motorPhaseCurrent;             //电机相电流(A) - mtpc
        public short motorOutputPower;               //电机输出功率(kw) - mtop (本应是unsigned byte)
        public short dcdcInputVoltage;              //DCDC输入电压(V),0~500 - dciv
        public short dcdcInputCurrent;              //DCDC输入电流(A),0~300 - dcic
        public short dcdcOutputVoltage;             //DCDC输出电压(V),0~24 - dcov
        public short dcdcOutputCurrent;             //DCDC输出电流(A),0~100 - dcoc
        public short dcdcTemperature;               //DCDC温度(℃),-40~210 - dct
    }

    //空调(通用) 0x06
    public static class AirConditionCommon{
        public byte outdoorTemperature;             //车外温度(℃) - ot
        public byte indoorTemperature1;             //车内温度1(℃) - it1
        public byte indoorTemperature2;             //车内温度2(℃) - it2
    }

    //电动汽车空调 0x07
    public static class AirConditionEv{
        public short compressorInputVoltage;        //空调压缩机输入电压 - civ
        public short compressorInputCurrent;        //空调压缩机输入电流(A) - cic
        public short compressorRpm;                 //空调压缩机转速(RPM) - crpm
        public byte compressorTemperature;          //空调压缩机温度(℃) - ct
        public short compressorPower;               //空调压缩机运行功率(w) - cp
        public short ptcInputVoltage;               //PTC输入电压(V) - piv
        public short ptcInputCurrent;               //PTC输入电流(A) - pic
        public short ptcPower;                      //PTC工作功率(w) - pp
    }

    //车载充电机 0x08
    public static class OnboardCharger{
        public short chargingVoltage;                //充电电压 - cv
        public short chargingCurrent;                //充电电流 - cc
        public byte chargerTemperature;              //充电器温度 - ct
    }
}
